<?php

namespace App\Repository\Models;

use Illuminate\Database\Eloquent\Model;
use Prettus\Repository\Contracts\Transformable;
use Prettus\Repository\Traits\TransformableTrait;

/**
 * Class Guestbook.
 *
 * @package namespace App\Repository\Models;
 */
class Guestbook extends Model implements Transformable
{
    use TransformableTrait;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $table    = 'guestbook';
    protected $fillable = ['id','type','park_title','category','park_name','park_phone','park_company','park_leaveWord','created_at','updated_at'];
    protected $appends  = ['park_type_name'];

    // 预约园区类型
    public static $book_type = [
        1 => '供应链金融',
        2 => '产业园区',
        3 => '一带一路',
    ];
    public function getParkTypeNameAttribute(){
        return self::$book_type[$this->type];
    }
}
